package com.example.om_export.app.upload.dao;


import com.example.om_export.app.upload.entity.SysAttachment;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface SysAttachmentMapper {
    int deleteByPrimaryKey(String id);

    int insert(SysAttachment record);

    int insertSelective(SysAttachment record);

    SysAttachment selectByPrimaryKey(String id);

    int updateByPrimaryKeySelective(SysAttachment record);

    int updateByPrimaryKey(SysAttachment record);

    /**
     * docunid 根据 docunid 修改delStatus为可用状态 del_status=1
     * @param docunid
     * @return
     */
    int updateDelStateByDocunId(@Param("docunid") String docunid, @Param("delState") Integer delState);

    /**
     * 根据docunid,delstate 删除附件
     * @param ids
     * @return
     */
    int deleteByIds(@Param("ids") List<String> ids);

    /**
     * 根据docunid,delstate 查询附件
     * @param ids
     * @return
     */
    List<SysAttachment> selectByIds(@Param("ids") List<String> ids);

    /**
     * 根据id批量更新del state状态
     * @param ids
     * @param delSate
     * @return
     */
    int updateDelStateByIds(@Param("ids") List<String> ids, @Param("delState") Integer delSate);
    
    /**
     * 根据文档id查询数据
     * @param docunid
     * @return
     */
    List<String> selectByDocunid(@Param("docunid") String docunid);

    /**
     * 根据delState查询列表
     * @param delState
     * @return
     */
    List<SysAttachment> selectByDelState(@Param("delState") int delState);

    /**
     * 根据delState删除记录
     * @param delState
     * @return
     */
    int deleteByDelState(@Param("delState") int delState);
}